// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   ServletFilter.java

package cn.com.pusai.common.filter;

import cn.com.pusai.common.config.SysProperties;
import cn.com.pusai.common.util.ServletUtil;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.filter.OncePerRequestFilter;

public class ServletFilter extends OncePerRequestFilter
{

	public ServletFilter()
	{
	}

	protected void doFilterInternal(HttpServletRequest servletRequest, HttpServletResponse servletResponse, FilterChain filterChain)
		throws ServletException, IOException
	{
		HttpServletRequest request;
		request = servletRequest;
		ServletUtil.bindCurrentHttpRequest(request);
		try
		{
			filterChain.doFilter(servletRequest, servletResponse);
		}
		catch (ServletException e)
		{
			e.printStackTrace();
			throw e;
		}
		catch (IOException e)
		{
			e.printStackTrace();
			throw e;
		}
		
		
	
		ServletUtil.cancelBindCurrentRequest(request);
		if (SysProperties.ROOT_URL == null)
			SysProperties.ROOT_URL = request.getContextPath();
		return;
	}
}
